package cc.aiee.demo.springboot.controller.chinapay.bean;

import cc.aiee.core.abstracts.AbstractQuickModel;
import cc.aiee.core.interfaces.PayJsonBeanInterface;
import cc.aiee.core.kit.KitJson;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@Schema(description = "退款接口")
@EqualsAndHashCode(callSuper = false)
public class ChinaPayRefundQuery extends AbstractQuickModel implements PayJsonBeanInterface {

	@Schema(description = "商户订单号", example = "20200925173336000XXZ", required = true, hidden = true)
	private String merOrderNo;

	@Schema(description = "原始交易订单号", required = true)
	private String oriOrderNo;

	@Schema(description = "原始交易日期", example = "20200925", required = true)
	private String oriTranDate;

	@Schema(description = "退款金额(分)", example = "1", required = true)
	private String refundAmt;

	@Schema(description = "交易类型 :0202 预授权完成 0203 预授权撤销 0204 预授权完成撤销 0401 退款交易 0402 退款撤销 0403 消费撤销 9908 通知分账 ", example = "0401",required = true)
	private String tranType = "0401";

	@Override
	public String toJson() {
		return KitJson.toJSONString(this);
	}

	@Override
	public String toJson(boolean prettyFormat, boolean ignoreNull) {
		return KitJson.toJSONString(this, prettyFormat, ignoreNull);
	}

	@Override
	public <T> T model(T cls) {
		BeanUtil.copyProperties(this, cls, true);
		return cls;
	}

}
